ProjectName.modules.Uom = {
    init: function() {
        this.uominitializer();
    },
    uominitializer: function() {
        $('body').delegate('.remove_unit', 'click', function() {
            $('.unit-delete-container').hide();
            var bool = confirm("Are you sure you want to delete this unit of measurement?");
            if (bool) {
                var postdata = {};
                var uom_id = $(this).attr('id');
                postdata['uom_id'] = uom_id;
                jQuery.post(BASE_PATH + '/preference/deleteuom', postdata, function(result) {
                    if (result === 'UOM_ALREADY_EXIST') {
                        $('.unit-delete-container').show();
                    } else {
                        window.location.href = window.location.href;
                    }

                });
            }
        });

    }

};
